import {defineComponent, ref} from "vue";
import "../css/index.css"
export default defineComponent({
    props: {
        queryParams: {
            type: Object,
            default: {}
        },
        handleQuery: {
            type: Function,
            default: () => {
            }
        },

    },
    setup(props) {
        const queryFormRef = ref(null)
        const enterDown = () => {
            console.log('enterdown')
        }
        const resetQuery = () => {
            console.log(queryFormRef,"queryFormRef")
            queryFormRef.value.resetFields()
            props.handleQuery()
        }
        return () => {
            return (
                <el-form model={props.queryParams} ref={queryFormRef} size={'small'} inline={true}>
                    <el-form-item label={'用户姓名'} name={'nick_name'} prop={'nick_name'}>
                        <el-input
                            class={'searchInput'}
                            v-model={props.queryParams.nick_name}
                            placeholder={'请输入用户姓名'}
                            clearable
                        />
                    </el-form-item>
                    <el-form-item>
                        <el-button type="primary" onclick={() => {
                            props.handleQuery()
                        }
                        }>搜索
                        </el-button>
                        <el-button onclick={() => resetQuery()}>重置
                        </el-button>
                    </el-form-item>
                </el-form>
            )
        }
    },
})